/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lk.asha.desktop.report.mamagerReport;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author user
 */
public class ReportRuuner {

    public static void runReport(String file ) throws IOException{

                try {
                    String cmd="java -jar \"D:\\Project\\New Folder\\JasperReport\\dist\\JasperReport.jar\" \"D:\\Project\\New Folder\\Report\\"+file;
      System.out.println(cmd);
                    Process proc = Runtime.getRuntime().exec(cmd);
        
        } catch (IOException e) {
        e.printStackTrace();
        }


    }

    public static void main(String a[]) throws IOException{
        Map map=new HashMap();
        map.put("parameter1","AAAAAAAAAA");
       // map.put("parameter1","AAAAAAAAAA");
    
        runReport("\"D:\\Project\\New Folder\\Report\\Customer.jrxml\"",map);

    }


        public static void runReport(String file ,Map map) throws IOException{

            try {
               System.out.println( map.get("parameter1"));
               System.out.println( map.get("parameter2"));
            } catch (Exception e) {
            }

                try {
        Process proc = Runtime.getRuntime().exec("java -jar \"D:\\Project\\New Folder\\JasperReport\\dist\\JasperReport.jar\" "+file);

        } catch (IOException e) {
        e.printStackTrace();
        }


    }

}
